package com.ticket.system.domain.enu;

import lombok.Getter;

/**
 * @ClassName : TicketStatusEnum
 * @Description :
 * @Author : lixiang
 * @Date: 2024/1/4  11:06
 */
@Getter
public enum TicketRefundStatusEnum {
    ONE(0,"待出票"),
    TWO(1,"已选定"),
    THREE(2,"已支付"),
    FOUR(3,"已取消"),
    FIVE(4,"已验票"),
    SIX(5,"待付款"),
    SEVEN(6,"已作废"),
    EIGHT(7,"退款中"),
    NIGH(8,"已过期");

    private final int code;

    private final String value;

    TicketRefundStatusEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static TicketRefundStatusEnum indexOf(Integer code) {
        for (TicketRefundStatusEnum obj : TicketRefundStatusEnum.values()) {
            if (code.equals(obj.getCode())) {
                return obj;
            }
        }
        return null;
    }

    public static TicketRefundStatusEnum indexOfMsg(String msg) {
        for (TicketRefundStatusEnum obj : TicketRefundStatusEnum.values()) {
            if (msg.equals(obj.getValue())) {
                return obj;
            }
        }
        return null;
    }
}
